import dolfinx # noqa: F401
import gmsh
import mpi4py.MPI
import viskex
import common_03_dolfinx as common # isort: skip
order = 3
Create a mesh of the unit disk with the provided order.
gmsh.initialize()
gmsh.option.setNumber("General.Verbosity", 1)
mesh, cell_tags, facet_tags, vertex_tags = common.create_unit_disk(
mpi4py.MPI.COMM_WORLD, order=order, num_segments=3)
gmsh.finalize()
Plot the mesh. Note that high order meshes appear more "curved" on the boundary of the circle.
viskex.dolfinx.plot_mesh(mesh)
Plot mesh facets (i.e. segments), highlighting their nodes. Note how the high orderer meshes have additional nodes compared to first order meshes. For instance, a second order mesh has a node in the midpoint of each segment. Similarly, a third order mesh has two nodes on each segment and a node in the barycenter of the cell.
viskex.dolfinx.plot_mesh(mesh, dim=1, show_vertices=True)
Plot mesh nodes. Note that high order meshes have more nodes than a first order one, as discussed above.
viskex.dolfinx.plot_mesh(mesh, dim=0)
Plot the cell tags, identifying four subdomains.
viskex.dolfinx.plot_mesh_tags(mesh, cell_tags, "Cell tags")
Plot the facet tags, identifying four boundaries and four interfaces.
viskex.dolfinx.plot_mesh_tags(mesh, facet_tags, "Facet tags")
Plot the vertex tags, identifying all vertices on the interfaces and the origin. Note that in high order meshes the high order nodes are not tagged.
if vertex_tags is not None: # dolfinx < 0.10.0 does not read vertex tags
viskex.dolfinx.plot_mesh_tags(mesh, vertex_tags, "Vertex tags")